package com.ds.robot.assistant.job;

import com.ds.robot.assistant.service.yunxiao.YunXiaoBugSyncClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 作用：
 *
 * @author WeiShaoying
 * 
 */
@Component
@Slf4j
public class SyncJob {

    @Autowired
    private YunXiaoBugSyncClient bugSyncClient;

    // 8-22点期间，每隔20分钟执行一次
    @Scheduled(cron = "0 5/20 8-21 * * ?")
    public void executeJob() {
        log.info("开始执行缺陷同步任务");
        bugSyncClient.doUpdateBug();
        log.info("结束执行缺陷同步任务");
    }

}
